package com.hosever.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hosever.core.AbstractServiceImpl;
import com.hosever.model.Article;
import com.hosever.model.Tag;

@Service
public class ArticleServiceImpl extends AbstractServiceImpl<Article> implements ArticleService{

	@Autowired
	TagService tagService;
	
	public List<Tag> findTagsById(String id) {
		String hql = String.format(" from Tag where id in ( "
				+ "select r.tagId from R_Article_Tag r where r.articleId='%s'"
				+ ")", id);
		return tagService.customQuery(hql);
	}

}
